<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>个人中心</title>
		<link rel="stylesheet" href="../css/main.css" />
		<link rel="stylesheet" href="../css/iconfont.css" />
		<link rel="stylesheet" href="../css/swiper.css" />
		<script src="../js/jquery.min.js"></script>
		<script src="../js/utils.js"></script>
		<script src="../js/vue.min.js"></script>
		<script src="../js/pinyin.js"></script>
	</head>
	<body>
		<div id="page_header" class="page-header"></div>
		<div id="page_menu" class="content-area menu items-display-flex flex-row flex-between"></div>
		<div id="city_sets"></div>
		<div id="maincontent" class="user-part">
			<div class="content-area content items-display-flex flex-row flex-between">
				<div class="left-menu">
					<div class="user-info">
						<img class="icon" src="../img/logo.png" id="userheadicon"/>
						<div class="lab">你好，{{nickname}}</div>
					</div>
					<div class="menus">
						<div @click='changeMenu(1)' class="menu" v-bind:class='[menuindex==1 ? "menu-active":"menu-no-active"]'>
							<img v-bind:src='menuindex==1 ? "../img/icon/loupan2.png":"../img/icon/loupan1.png"' />关注的楼盘
						</div>
						<div @click='changeMenu(2)' class="menu" v-bind:class='[menuindex==2 ? "menu-active":"menu-no-active"]'>
							<img v-bind:src='menuindex==2 ? "../img/icon/coupon2.png":"../img/icon/coupon1.png"' />我的优惠券
						</div>
						<div @click='changeMenu(3)' class="menu" v-bind:class='[menuindex==3 ? "menu-active":"menu-no-active"]'>
							<img v-bind:src='menuindex==3 ? "../img/icon/yewu2.png":"../img/icon/yewu1.png"' />业务报表&nbsp;&nbsp;&nbsp;
						</div>
						<div @click='changeMenu(4)' class="menu" v-bind:class='[menuindex==4 ? "menu-active":"menu-no-active"]'>
							<img v-bind:src='menuindex==4 ? "../img/icon/person2.png":"../img/icon/person1.png"' />个人资料&nbsp;&nbsp;&nbsp;
						</div>
					</div>
				</div>
				<div class="right-contents">
					<div class="top">
						<span>欢迎来到口袋买房！</span>
					</div>
					<div class="content" v-if='menuindex==1'>
						<div class="demo" style="padding-top: 10px;" id='follow'>#这里是关注的楼盘</div>
					</div>
					<div class="content" v-else-if='menuindex==2'>
						<div class="demo" style="padding-top: 10px;" id='follow'>#这里是我的优惠券</div>
					</div>
					<div class="content" v-else-if='menuindex==3'>
						<div class="demo" style="padding-top: 10px;" id='follow'>#这里是业务报表</div>
					</div>
					<div class="content" v-else-if='menuindex==4'>
						<div class="demo" style="padding-top: 10px;" id='follow'>#这里是个人资料</div>
					</div>
				</div>
			</div>
		</div>
		<div id="page_footer" class="page-footer no-margin"></div>
	</body>
	<script>
		notLogin();
		
		$(document).ready(function() {
			
			var menupar = getParameter('menu');
			if(menupar){
				maincnt.menuindex = menupar;
			}
			else{
				maincnt.menuindex = 1;
			}
			
			document.body.style.display = 'inherit';
			loadHeaderAndFooter();
		});
		
		
		
		function loadHeaderAndFooter() {
			$('#page_header').load('../template/header.html');
			$('#page_menu').load('../template/mainmenu.html', function() {
				maincnt.changeMenu(maincnt.menuindex);
			});
			$('#city_sets').load('../template/choosecity.html');
			$('#page_footer').load('../template/footer.html');
		}
		var maincnt = new Vue({
			el:'#maincontent',
			data:{
				menuindex:0,
				nickname:''
			},
			methods:{
				changeMenu:function(index){
					this.menuindex = index;
					if(this.menuindex == 1){
						$('#follow').load('../user/user_follow.html');
					}
					else if(this.menuindex == 2){
						$('#follow').load('../user/user_coupon.html');
					}
					else if(this.menuindex == 3){
						$('#follow').load('../user/user_Report.html');
					}
					else if(this.menuindex == 4){
						//这里是个人中心
						$('#follow').load('../user/user_info.html');
					}
				},
				clearAllPanl:function(){
					$('#follow').hide();
					$('#couponpanl').hide();
				}
			}
		});
		
		function userbackInfo(){
			var uinfo = getUserInfo();
			if(uinfo){
				maincnt.nickname = uinfo.nickname;
				document.getElementById("userheadicon").src = uinfo.headimgurl;
			}
		}
		
		userbackInfo();
		
	</script>
</html>
